package com.tech.arno.spicy.mvp.presenterImpl;

import com.tech.arno.spicy.module.update.UpdateModel;
import com.tech.arno.spicy.mvp.presenter.MinePresenter;
import com.tech.arno.spicy.mvp.view.MineFragmentView;
import com.tech.arno.spicy.network.http.RequestCenter;
import com.tech.arno.spicysdk.okhttp.listener.DisposeDataListener;

/*
*   @package:     com.tech.arno.spicy.mvp.presenterImpl
*   @fileName:    MinePresenterImpl
*   @author:    ArnoFrost
*   @date:  2017/12/22 0022 9:43
*   @desc:     个人中心Presenter 实现类
*/

public class MinePresenterImpl implements MinePresenter {
    MineFragmentView mineFragmentView;

    public MinePresenterImpl(MineFragmentView mineFragmentView) {
        this.mineFragmentView = mineFragmentView;
    }

    @Override
    public void checkVersion() {
        RequestCenter.checkVersion(new DisposeDataListener() {
            @Override
            public void onSuccess(Object responseObj) {
                mineFragmentView.checkSuccess((UpdateModel) responseObj);
            }

            @Override
            public void onFailure(Object reasonObj) {
                mineFragmentView.checkFail((UpdateModel) reasonObj);
            }
        });
    }

    @Override

    public void onDestroy() {
        mineFragmentView = null;
    }
}
